
import request from '@/utils/request'

// 增
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data // 请求体body
  })
}

// 获取所有
export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

// 删
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 修改
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data// 请求体body
  })
}

// 根据ID查询详情
export function getDepartmentsDetail(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}

